package com.lhb.common.components;

import javax.swing.*;
import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

public class TopPanelButton extends JButton {


    public TopPanelButton(String text,Color oldColor,Color newColor) {

        setText(text);
        setBackground(oldColor);
        setForeground(Color.WHITE);
        setFocusPainted(false);
        setBorderPainted(false);
        setCursor(new Cursor(Cursor.HAND_CURSOR));
        addMouseListener(new MouseAdapter() {
            @Override
            public void mouseClicked(MouseEvent e) {

            }

            @Override
            public void mouseEntered(MouseEvent e) {
                setBackground(newColor);
            }

            @Override
            public void mouseExited(MouseEvent e) {
                setBackground(oldColor);
            }
        });

    }






}
